import 'package:flutter/material.dart';

class LogoGenerator extends StatefulWidget {
  @override
  _LogoGeneratorState createState() => _LogoGeneratorState();
}

class _LogoGeneratorState extends State<LogoGenerator> {
  var _left = '';
  var _right = '';
  var ts = TextStyle(
    color: Colors.white,
    fontSize: 30,
    fontWeight: FontWeight.bold,
  );

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('logo生成器'),
      ),
      body: Column(
        children: <Widget>[
          Row(
            children: <Widget>[
              Flexible(
                child: TextField(
                  onChanged: (v) {
                    setState(() {
                      _left = v;
                    });
                  },
                ),
              ),
              SizedBox(
                width: 8,
              ),
              Flexible(
                child: TextField(
                  onChanged: (v) {
                    setState(() {
                      _right = v;
                    });
                  },
                ),
              ),
              RaisedButton(
                child: Text('生成'),
                onPressed: () {},
              )
            ],
          ),
          SizedBox(
            height: 16,
          ),
          Container(
            color: Colors.black,
            width: 200,
            height: 100,
            child: Center(
              child: Wrap(
                spacing: 6,
                crossAxisAlignment: WrapCrossAlignment.center,
                children: <Widget>[
                  Text(_left, style: ts),
                  Container(
                    padding: EdgeInsets.all(8),
                    decoration: BoxDecoration(
                      color: Color(0xfffe9a00),
                      borderRadius: BorderRadius.all(
                        Radius.circular(4),
                      ),
                    ),
                    child: Text(_right, style: ts.apply(color: Colors.black)),
                  ),
                ],
              ),
            ),
          ),
        ],
      ),
    );
  }
}
